<template>
	
	  <el-breadcrumb  style="padding: 30px;">
	     <el-breadcrumb-item>首页</el-breadcrumb-item>
	     <el-breadcrumb-item>小程序数据</el-breadcrumb-item>
	     <el-breadcrumb-item>订单列表</el-breadcrumb-item>
	  </el-breadcrumb>
	  <el-form :inline="true"  class="demo-form-inline">
	    <el-form-item label="">
	      <el-input v-model="numbers"  placeholder="输入搜索的手机号码"></el-input>
	    </el-form-item>
	   
	   <el-form-item>
	      <el-button type="primary" @click="getData" >搜索</el-button>
	    </el-form-item>
	  </el-form>
	<el-table class="mb20" :data="tableData" border style="width: 100%">
		<el-table-column prop="tel" label="手机号码" />
		<el-table-column prop="order_sn" label="订单号" />
		<el-table-column prop="receiver" label="真实姓名" />
		<el-table-column prop="price" label="付款金额" />
		<el-table-column prop="addtime" label="创建时间" >	
		<template #default="scope">
			
				{{dayjs(scope.row.addtime*1000).format("YYYY-MM-DD HH:mm") }}
		</template>
		</el-table-column>
		<el-table-column prop="addtime" label="订单状态" >
		<template #default="scope">		
				<el-tag
				    :type="scope.row.status==10?'success':''"
				    effect="dark">
				   {{ scope.row.status==10?"未付款":"已付款" }}
				  </el-tag>  
		</template>
		</el-table-column>
	</el-table>
	
	
	
</template>

<script lang="ts">

			
    import dayjs from "dayjs"
	import QRCode from 'qrcodejs2'
	import moment from "moment"
	import editorWang from '../components/wangEnduit'
	import {
		ElMessageBox,
		ElMessage
	} from 'element-plus'
	export default {
		components:{
			editorWang
		},
		watch:{
			times(){
				this.form.starttime=this.times[0];
				this.form.endtime=this.times[1];
			},
		},
		data() {
			return {
				dayjs:dayjs,
				yzm:"",
				code:"",
				viewarr:[],
				modalStatewins:false,
				hdqtxmname:"",//     名称
				hdorders :"",//   加排序
				numbers :"",//  手机
				modalStatewin:false,
				qrcode:null,
				modalStatecode:false,
				vtimes:['',''],
				formLabelWidth: '120px',
				times:"",
				form: {
					num:"",
					images:"",
					jifen:"",
					orders:"",
					hdname:"",
				},
				tableData:[],
				rules: {
				        
						
						
				},
				pid: []
			}
		},
		mounted() {
			this.getData();		
		},
		methods: {
			
			
			edites(data){
				console.log(data.row)
				data.row.is_show=data.row.is_show+'';
				delete data.row.ewmid;
				var data =JSON.parse(JSON.stringify(data.row))
				this.times=[data.starttime,data.endtime];	
			},
			
           
			getData() {
				this.$http.post("/index.php/index/goods/orderlist",{numbers:this.numbers}).then(data => {
					console.log(data)
					this.tableData=data[0];

				})
			},
			submit(ref) {
				console.log(this.$refs)
				if(this.code!=this.form.yzm){
					ElMessage({
								message:  '请输入正确的兑换码',
								type: 'error',
							})
					return 
				}
					this.$http.post("/index.php/index/Hddh/hthddhzt",
						{...this.form}).then(data => {
						console.log(data)
						this.modalState = false;
						ElMessage({
							message: '兑换成功',
							type: 'success',
						})
						this.getData();
					})
				// this.doRules(this.$refs[ref]).then(()=>{
				// 	if (this.id) this.form.id = this.id;
					
				
				// })
				
			},
			remove(data){
				this.$http.post("/index.php/index/Hddh/hddhdel",{id:data.row.id}).then(data => {
					ElMessage({
						message: '删除成功' ,
						type: 'success',
					})
					this.getData();
				})
			},
			handleAvatarSuccess(file) {

				this.form.image = file.data;
			},
			


		}
	}
</script>
